#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;


int main() {
    int n = 0;
    cin >> n;
    int m = 0;
    cin >> m;

    //int x[n];   //[n] n必须给一个常量，不能给变量
    //int y[n];
    int x[1000];  //下菜时间
    int y[1000];  //烧菜时间
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i];
    }
    
    vector<int>eattime(n+1, 0); //可以吃的时间 // 一维数组，有n+1个0
    //eattime[0] = 0;
    for (int i = 1; i < n+1; i++)
    {
        eattime[i] = x[i-1] + y[i-1];
    }
    sort(eattime.begin(), eattime.end());

    //int pre = 0; 
    int cnt = 0; //记录吃到的菜的数量
    for (int i = 1; i < n+1; i++)
    {
        if (eattime[i] >= eattime[i-1] + m)
        {
            //pre = eattime[i];
            cnt += 1;
        }
    }
    cout << cnt << endl;

	system("pause");
	return 0;
}











